package com.helloniu.red5.adm;

import java.util.ArrayList;

import org.red5.io.utils.ObjectMap;


public class BussinessManager {
	private static BussinessManager bussinessManager = new BussinessManager();
	private BussinessManager() {		
	}
	
	public static BussinessManager getInstance() {		
		return bussinessManager;
	}
	

	public void addShape(ObjectMap shape) {
		shapeList.add(shape);
	}
	
	public void removeShape(ObjectMap shape) {
		shapeList.remove(shape);
	}
	
	public void changeShape(ObjectMap newShape) {
		for(ObjectMap oldShape:shapeList) {
			if(oldShape.get("shapeID").equals(newShape.get("shapeID"))) {
				oldShape.put("shapePoints", newShape.get("shapePoints"));
				return;
			}
		}		
	}
	
	public ArrayList<ObjectMap> shapeList = new ArrayList<ObjectMap>();
}
